import { NavLink } from "react-router-dom";
import { getTypeOneList } from "../../views/tools/ajax";
import { useState, useEffect } from "react";
import "./searchs.scss"
function Searchs() {
  let [list, setList] = useState([]);
  async function aa() {
    let res = await getTypeOneList();
    list = res.data;
    setList([...list].splice(0, 9));
    console.log(list);
  }
//   

//   
  useEffect(() => {
    aa();
  }, []);
  return (
    <ul className="uls">
      {list.map((item,index) => {
        return (
         <NavLink to={"/search/"+item} state={item}>
            <li className="lis" key={index}>
                <div className="as">{item}</div>
            </li>
          </NavLink>
        );
      })}
    </ul>
  );
}
export default Searchs;
